Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eagerly address select Rust 2024 edition changes #155

Merged
merged 2 commits into from
Apr 15, 2024

Conversation

mciantyre
Copy link
Member

@mciantyre mciantyre commented Apr 10, 2024

The 2024 edition enables unsafe_op_in_unsafe_fn by default. This PR adds unsafe blocks and safety considerations throughout HAL and logging packages. There shouldn't be any functional changes.

Today's stable toolchain (1.77) also warns about the explicit references to static muts. I'm taking the simple approach to resolve this eventual hard error.

Tested on an 1170EVK using the rtic_logging example, with both backends and both frontends.

Requires us to document safety within our own unsafe functions. See Rust
RFC 2585 for more information. This warning promotes to an error in CI.
This becomes a hard error in the 2024 edition, so this commit is for
future proofing. Safety comment indicates that there's only one mutable
reference to this static that's live at a time.
@mciantyre mciantyre merged commit 0b63096 into imxrt-rs:main Apr 15, 2024
31 checks passed
@mciantyre mciantyre deleted the rust-2024-edition branch April 15, 2024 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants